package com.dubbo.impl;

import com.dubbo.model.Order;
import com.dubbo.service.OrderService;

import java.util.UUID;

/**
 * @author LING
 * 新增订单接口实现类
 */
public class OrderServiceImpl implements OrderService {
    @Override
    public Order addOrder(Integer userId, String goodsName, Double price, Integer amount) {
        //随机生成唯一订单号
        String orderId = UUID.randomUUID().toString();
        //后台显示订单数据
        System.out.println("用户名："+userId);
        System.out.println("订单号："+orderId);

        Order order = new Order(orderId,goodsName,price,amount);
        //返回订单数据
        return order;
    }
}
